﻿namespace TestClassLibrary
{
	using System;
	using System.Collections.Generic;

	class PrivateTestClass
	{
		static private int StaticPrivateField;
		static protected int StaticProtectedField;
		static public int StaticPublicField;
		static internal int StaticInternalField;
		static protected internal int StaticProtectedInternalField;

		static private int StaticPrivateProperty { get; set; }
		static protected int StaticProtectedProperty { get; set; }
		static public int StaticPublicProperty { get; set; }
		static internal int StaticInternalProperty { get; set; }
		static protected internal int StaticProtectedInternalProperty { get; set; }

		static int count; // counts method calls

		static private Accessors StaticPrivateMethod() { ++count; return Accessors.StaticPrivate; }
		static protected Accessors StaticProtectedMethod() { ++count; return Accessors.StaticProtected; }
		static public Accessors StaticPublicMethod() { ++count; return Accessors.StaticPublic; }
		static internal Accessors StaticInternalMethod() { ++count; return Accessors.StaticInternal; }
		static internal protected Accessors StaticInternalProtectedMethod() { ++count; return Accessors.StaticInternalProtected; }

		private int PrivateField;
		protected int ProtectedField;
		public int PublicField;
		internal int InternalField;
		protected internal int ProtectedInternalField;

		private int PrivateProperty { get; set; }
		protected int ProtectedProperty { get; set; }
		public int PublicProperty { get; set; }
		internal int InternalProperty { get; set; }
		protected internal int ProtectedInternalProperty { get; set; }

		private Accessors PrivateMethod() { ++count; return Accessors.Private; }
		protected Accessors ProtectedMethod() { ++count; return Accessors.Protected; }
		public Accessors PublicMethod() { ++count; return Accessors.Public; }
		internal Accessors InternalMethod() { ++count; return Accessors.Internal; }
		internal protected Accessors InternalProtectedMethod() { ++count; return Accessors.InternalProtected; }

		static PrivateTestClass() { }
		public PrivateTestClass() { }
		public PrivateTestClass(PublicConstructor x) { }
		protected PrivateTestClass(ProtectedConstructor x) { }
		private PrivateTestClass(PrivateConstructor x) { }
		internal PrivateTestClass(InternalConstructor x) { }
		protected internal PrivateTestClass(ProtectedInternalConstructor x) { }

		// not complete, but sufficient? (tests both private/private and public/private)
		protected int ProtectedGetPrivateSetProperty { get; private set; }
		public int PublicGetPrivateSetProperty { get; private set; }

		// idem (tests readonly fields)
		private readonly double PrivateReadonlyField;
		public readonly double PublicReadonlyField;

		PrivateTestClass PrivateTypeSelfReferencingField;
		PrivateTestClass PrivateTypeSelfReferencingProperty { get; set; }
		PrivateTestClass PrivateTypeSelfReferencingMethod(PrivateTestClass x) { return x; }

		List<int> GenericField;
		List<int> GenericProperty { get; set; }
		List<int> GenericMethod(List<int> x) { return x; }

		// System.CodeDom does not support add {} remove {} construct for events,
		// so it is impossible to create language-agnostic wrapper code for events easily.
		// This event is merely here to ensure the generator doesn't get confused by events.
		public static event EventHandler<EventArgs> MyEvent;
	}

	//class Accessor
	//{
	//   public event EventHandler<EventArgs> MyEvent
	//   {
	//      add { PrivateTestClass.MyEvent += value; }
	//      remove { PrivateTestClass.MyEvent -= value; }
	//   }
	//}
}
